import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import React, { lazy } from "react";
import App from "../views/App";
import Login from "../views/Login";
// import Fast from "../views/Fast";
// import Home from "../views/Home";
// import Mine from "../views/Mine";
// import Practise from "../views/Practise";
// import Select from "../views/Select";
// import Subjects from "../views/Subjects";

// 路由懒加载
const Fast = lazy(() => import("../views/Fast"));
const Home = lazy(() => import("../views/Home"));
const Mine = lazy(() => import("../views/Mine"));
const Practise = lazy(() => import("../views/Practise"));
const Select = lazy(() => import("../views/Select"));
const Subjects = lazy(() => import("../views/Subjects"));

const router = (
  <Router>
    <Routes>
      <Route path="/login" element={<Login />}></Route>
      <Route path="/" element={<App />}>
        <Route path="home" element={<Home />}></Route>
        <Route path="fast" element={<Fast />}></Route>
        <Route path="mine" element={<Mine />}></Route>
        <Route path="select/:actionCode" element={<Select />}></Route>
        <Route path="practise" element={<Practise />}></Route>
        <Route path="subjects/:actionCode" element={<Subjects />}></Route>
      </Route>
    </Routes>
  </Router>
);
export default router;
